package com.hex.ds.hdrs.common.enums;

public enum JobPeriodEnum {

    D("D", "日"),
    W("W", "周"),
    M("M", "月"),
    Q("Q", "季"),
    Y("Y", "年"),
    O("O", "自定义");

    private String value;
    private String name;

    private JobPeriodEnum(String name, String value) {
        this.value = value;
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static JobPeriodEnum fromJobPeriodEnum(String name) {
        for (JobPeriodEnum type : JobPeriodEnum.values()) {
            if (type.getName().equals(name)) {
                return type;
            }
        }
        return null;
    }
}
